public class ActionKeyHandle {
    private static final char[] orders = {'j', 'J', 'K', 'k'};
    public void actionKey(char[] ocr) {
        boolean isAction = false;
        if (ocr.length == 0) {
            return;
        }
        for (char order : orders) {
            //只要匹配一个即可
            if (ocr[0] == order) {
                isAction = true;
                break;
            }
        }
        if (isAction) {
            doAction(ocr);
        }
    }

    private void doAction(char[] ocr) {
        for (char o : ocr) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            RobotUtil.ROBOT.keyPress((int)o);
        }

    }

}
